Table of Content

Install & Usage

Develop

F&Q

SpirtiMobile H5 User Manual


SpirtiMobile H5 is an H5 container that encapsulates Spirit and gives Javascript the ability to operate printing devices. The API is basically the same as the desktop platform, which is convenient for program migration. For the API, please refer to spirit JS API

SpirtiMobile H5 is suitable for rapid development of small applications. For more demanding projects, you can use SpiritMobile Andorid SDK.

basic concepts

In essence, SpirtiMobile H5 is an HTML 5 shell, except for printing capabilities, it is no different from H5 containers such as PhoneGap: It also requires a Web server to store applications written in HTML5/JS/CSS, which is also in the Webview of the mobile terminal. Run and display the page. Therefore, the development model of SpirtiMobile H5 application is exactly the same as the general H5 container.

At the same time, the platform provides APP management functions: you can specify an ID for H5 applications, and set HOME_URL to point to your web server. When distributing the application, APP_ID can be used instead of the URL, which simplifies the distribution of the application.

![spirit_h5](/img/spirit_mobile_h5.png) Schematic diagram of SpirtiMobile H5 principle

In order to facilitate testing, the platform provides two test APPs: demo1, demo2, after installing SpiritMobile H5, you can check the correctness of the environment by installing the demo APP. The HOME_URLs of the demo APP are: http://www.printspirit.cn/demo/mobile1, http://www.printspirit.cn/demo/mobile2, you can use any tool to view the source code, as a reference when developing programs.

demo1 demo2

SpirtiMobile H5 APP creation steps


  1. Use H5/JS to develop applications.
  2. Create H5 App, set HOME_URL to point to the developed application, and generate APP_ID and password.
  3. Download and install SpiritH5 App.
  4. Run SpiritH5, enter APP_ID and password to complete the installation of the application.
  5. Repeat steps 3-4 to install any number of terminals.
  6. If there is a version upgrade, modify and deploy the server program, all terminals will be automatically upgraded.

Use H5/JS to develop applications

You can develop your application according to the conventional H5/JS program, and you need to pay attention to the following points.

  1. You must import spirit-mobile.js to call the print API. The reference address is: http://www.printspirit.cn/js/spirit-mobile.js, it is recommended to make a copy on your server.
  2. Remember the url of the program entry, it will be used when creating the APP.
  3. Any number of pages can be jumped in the program, but ** the domain name of the printed page must be the same as the domain name of HOME_URL in the creation of the APP (see next step)**.

Your program needs to be deployed on your own server. Spirit itself does not provide installation space for the application. Access control is controlled by your program itself, which is more secure.

Create H5 App

After registering and login, click H5 App Management to create an App. 1

To create an H5 APP, you need to provide three items:

  1. APP_ID-Alphanumeric, arbitrarily set, globally unique and cannot be repeated.
  2. home_url-points to the home page address of your application.
  3. Password-The password that needs to be entered when installing the APP on the mobile device.

Download and set up SpiritH5 App

Download and install SpiritH5 through the following link SpiritH5 App. When you run SpiritH5 for the first time, you need to use the APPID and password obtained in the previous step.

When testing, you can enter demo1 or demo2 with APPID, and the password is both 111111.

Add terminal license

The newly created APP includes a terminal installation license by default. If you need to install more terminals, please purchase the installation license on the H5 APP management page.


Leave Your Message

login